$(function(){
	var num_info = $('.num_info').html();//优惠券的数量
	var quan_price = $('.quan_price').html();//优惠券的单价
	var minusDark = $('#minusDark').val();
	var addDark = $('#addDark').val();
	var minusLight = $('#minusLight').val();
	var addLight = $('#addLight').val();
	$('#numGoods').val($('.num_info').html());
	$('#goodsSumPrice').val($('.order_sum_price').html());
	$('.get_data01').val(num_info);
	$('.get_data02').val($('.order_sum_price').html());
	$('.add').click(function(){//增加优惠券数量
		num_info ++;
		$('.num_info').html(num_info);
		$(this).addClass('light');
		$('.minus').removeClass('light');
		$('.price_quan').html(num_info*quan_price);
		$('.order_sum_price').html(num_info*quan_price);
		$('.get_data01').val(num_info);
		$('.get_data02').val($('.order_sum_price').html());
		$(this).find('img').attr({
			'src' : addLight,
			'data-src' : addLight
		});
		$('.minus').find('img').attr({
			'src' : minusDark,
			'data-src' : minusDark
		});
		$('#numGoods').val($('.num_info').html());
		$('#goodsSumPrice').val($('.order_sum_price').html());
	})
	$('.minus').click(function(){//减少优惠券数量
		$(this).find('img').attr({
			'src' : minusLight,
			'data-src' : minusLight
		});
		$('.add').find('img').attr({
			'src' : addDark,
			'data-src' : addDark
		});
		num_info = $('.num_info').html();
		if(num_info > 1){
			num_info --;
			$('.num_info').html(num_info);
			$(this).addClass('light');
			$('.add').removeClass('light');
			$('.price_quan').html(num_info*quan_price);
			$('.order_sum_price').html(num_info*quan_price);
			$('.get_data01').val(num_info);
			$('.get_data02').val($('.order_sum_price').html());
		}
		$('#numGoods').val($('.num_info').html());
		$('#goodsSumPrice').val($('.order_sum_price').html());
	})
	/*var exp = /^1([23578])\d{9}$/;*///判断手机号码
	var phone_text = $('.phone_text').val();
	var old_phone,new_phone,hide_phone;
	if(phone_text != ''){
		old_phone = phone_text.substr(0,4);
		hide_phone = phone_text.substr(7);
		new_phone = old_phone+"****"+hide_phone;
		$('.phone_text').val(new_phone);
	}
	$('.phone_text').focus(function(){
		$(this).val(phone_text);
	})
	$('.phone_text').blur(function(){
		phone_text = $('.phone_text').val();
		if(phone_text != ''){
			old_phone = phone_text.substr(0,4);
			hide_phone = phone_text.substr(7);
			new_phone = old_phone+"****"+hide_phone;
			$(this).val(new_phone);
		}
	})
})
